{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "pd.set_option(\"display.precision\", 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>Account length</th>\n",
       "      <th>Area code</th>\n",
       "      <th>International plan</th>\n",
       "      <th>Voice mail plan</th>\n",
       "      <th>Number vmail messages</th>\n",
       "      <th>Total day minutes</th>\n",
       "      <th>Total day calls</th>\n",
       "      <th>Total day charge</th>\n",
       "      <th>Total eve minutes</th>\n",
       "      <th>Total eve calls</th>\n",
       "      <th>Total eve charge</th>\n",
       "      <th>Total night minutes</th>\n",
       "      <th>Total night calls</th>\n",
       "      <th>Total night charge</th>\n",
       "      <th>Total intl minutes</th>\n",
       "      <th>Total intl calls</th>\n",
       "      <th>Total intl charge</th>\n",
       "      <th>Customer service calls</th>\n",
       "      <th>Churn</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>KS</td>\n",
       "      <td>128</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>25</td>\n",
       "      <td>265.1</td>\n",
       "      <td>110</td>\n",
       "      <td>45.07</td>\n",
       "      <td>197.4</td>\n",
       "      <td>99</td>\n",
       "      <td>16.78</td>\n",
       "      <td>244.7</td>\n",
       "      <td>91</td>\n",
       "      <td>11.01</td>\n",
       "      <td>10.0</td>\n",
       "      <td>3</td>\n",
       "      <td>2.70</td>\n",
       "      <td>1</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>OH</td>\n",
       "      <td>107</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>26</td>\n",
       "      <td>161.6</td>\n",
       "      <td>123</td>\n",
       "      <td>27.47</td>\n",
       "      <td>195.5</td>\n",
       "      <td>103</td>\n",
       "      <td>16.62</td>\n",
       "      <td>254.4</td>\n",
       "      <td>103</td>\n",
       "      <td>11.45</td>\n",
       "      <td>13.7</td>\n",
       "      <td>3</td>\n",
       "      <td>3.70</td>\n",
       "      <td>1</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NJ</td>\n",
       "      <td>137</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>243.4</td>\n",
       "      <td>114</td>\n",
       "      <td>41.38</td>\n",
       "      <td>121.2</td>\n",
       "      <td>110</td>\n",
       "      <td>10.30</td>\n",
       "      <td>162.6</td>\n",
       "      <td>104</td>\n",
       "      <td>7.32</td>\n",
       "      <td>12.2</td>\n",
       "      <td>5</td>\n",
       "      <td>3.29</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>OH</td>\n",
       "      <td>84</td>\n",
       "      <td>408</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>299.4</td>\n",
       "      <td>71</td>\n",
       "      <td>50.90</td>\n",
       "      <td>61.9</td>\n",
       "      <td>88</td>\n",
       "      <td>5.26</td>\n",
       "      <td>196.9</td>\n",
       "      <td>89</td>\n",
       "      <td>8.86</td>\n",
       "      <td>6.6</td>\n",
       "      <td>7</td>\n",
       "      <td>1.78</td>\n",
       "      <td>2</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>OK</td>\n",
       "      <td>75</td>\n",
       "      <td>415</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>166.7</td>\n",
       "      <td>113</td>\n",
       "      <td>28.34</td>\n",
       "      <td>148.3</td>\n",
       "      <td>122</td>\n",
       "      <td>12.61</td>\n",
       "      <td>186.9</td>\n",
       "      <td>121</td>\n",
       "      <td>8.41</td>\n",
       "      <td>10.1</td>\n",
       "      <td>3</td>\n",
       "      <td>2.73</td>\n",
       "      <td>3</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  State  Account length  Area code International plan Voice mail plan  \\\n",
       "0    KS             128        415                 No             Yes   \n",
       "1    OH             107        415                 No             Yes   \n",
       "2    NJ             137        415                 No              No   \n",
       "3    OH              84        408                Yes              No   \n",
       "4    OK              75        415                Yes              No   \n",
       "\n",
       "   Number vmail messages  Total day minutes  Total day calls  \\\n",
       "0                     25              265.1              110   \n",
       "1                     26              161.6              123   \n",
       "2                      0              243.4              114   \n",
       "3                      0              299.4               71   \n",
       "4                      0              166.7              113   \n",
       "\n",
       "   Total day charge  Total eve minutes  Total eve calls  Total eve charge  \\\n",
       "0             45.07              197.4               99             16.78   \n",
       "1             27.47              195.5              103             16.62   \n",
       "2             41.38              121.2              110             10.30   \n",
       "3             50.90               61.9               88              5.26   \n",
       "4             28.34              148.3              122             12.61   \n",
       "\n",
       "   Total night minutes  Total night calls  Total night charge  \\\n",
       "0                244.7                 91               11.01   \n",
       "1                254.4                103               11.45   \n",
       "2                162.6                104                7.32   \n",
       "3                196.9                 89                8.86   \n",
       "4                186.9                121                8.41   \n",
       "\n",
       "   Total intl minutes  Total intl calls  Total intl charge  \\\n",
       "0                10.0                 3               2.70   \n",
       "1                13.7                 3               3.70   \n",
       "2                12.2                 5               3.29   \n",
       "3                 6.6                 7               1.78   \n",
       "4                10.1                 3               2.73   \n",
       "\n",
       "   Customer service calls  Churn  \n",
       "0                       1  False  \n",
       "1                       1  False  \n",
       "2                       0  False  \n",
       "3                       2  False  \n",
       "4                       3  False  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(\"data/telecom_churn.csv\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(3333, 20)\n"
     ]
    }
   ],
   "source": [
    "print(df.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Index(['State', 'Account length', 'Area code', 'International plan',\n",
      "       'Voice mail plan', 'Number vmail messages', 'Total day minutes',\n",
      "       'Total day calls', 'Total day charge', 'Total eve minutes',\n",
      "       'Total eve calls', 'Total eve charge', 'Total night minutes',\n",
      "       'Total night calls', 'Total night charge', 'Total intl minutes',\n",
      "       'Total intl calls', 'Total intl charge', 'Customer service calls',\n",
      "       'Churn'],\n",
      "      dtype='object')\n"
     ]
    }
   ],
   "source": [
    "print(df.columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 3333 entries, 0 to 3332\n",
      "Data columns (total 20 columns):\n",
      " #   Column                  Non-Null Count  Dtype  \n",
      "---  ------                  --------------  -----  \n",
      " 0   State                   3333 non-null   object \n",
      " 1   Account length          3333 non-null   int64  \n",
      " 2   Area code               3333 non-null   int64  \n",
      " 3   International plan      3333 non-null   object \n",
      " 4   Voice mail plan         3333 non-null   object \n",
      " 5   Number vmail messages   3333 non-null   int64  \n",
      " 6   Total day minutes       3333 non-null   float64\n",
      " 7   Total day calls         3333 non-null   int64  \n",
      " 8   Total day charge        3333 non-null   float64\n",
      " 9   Total eve minutes       3333 non-null   float64\n",
      " 10  Total eve calls         3333 non-null   int64  \n",
      " 11  Total eve charge        3333 non-null   float64\n",
      " 12  Total night minutes     3333 non-null   float64\n",
      " 13  Total night calls       3333 non-null   int64  \n",
      " 14  Total night charge      3333 non-null   float64\n",
      " 15  Total intl minutes      3333 non-null   float64\n",
      " 16  Total intl calls        3333 non-null   int64  \n",
      " 17  Total intl charge       3333 non-null   float64\n",
      " 18  Customer service calls  3333 non-null   int64  \n",
      " 19  Churn                   3333 non-null   bool   \n",
      "dtypes: bool(1), float64(8), int64(8), object(3)\n",
      "memory usage: 498.1+ KB\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "print(df.info())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>Account length</th>\n",
       "      <th>Area code</th>\n",
       "      <th>International plan</th>\n",
       "      <th>Voice mail plan</th>\n",
       "      <th>Number vmail messages</th>\n",
       "      <th>Total day minutes</th>\n",
       "      <th>Total day calls</th>\n",
       "      <th>Total day charge</th>\n",
       "      <th>Total eve minutes</th>\n",
       "      <th>Total eve calls</th>\n",
       "      <th>Total eve charge</th>\n",
       "      <th>Total night minutes</th>\n",
       "      <th>Total night calls</th>\n",
       "      <th>Total night charge</th>\n",
       "      <th>Total intl minutes</th>\n",
       "      <th>Total intl calls</th>\n",
       "      <th>Total intl charge</th>\n",
       "      <th>Customer service calls</th>\n",
       "      <th>Churn</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>KS</td>\n",
       "      <td>128</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>25</td>\n",
       "      <td>265.1</td>\n",
       "      <td>110</td>\n",
       "      <td>45.07</td>\n",
       "      <td>197.4</td>\n",
       "      <td>99</td>\n",
       "      <td>16.78</td>\n",
       "      <td>244.7</td>\n",
       "      <td>91</td>\n",
       "      <td>11.01</td>\n",
       "      <td>10.0</td>\n",
       "      <td>3</td>\n",
       "      <td>2.70</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>OH</td>\n",
       "      <td>107</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>26</td>\n",
       "      <td>161.6</td>\n",
       "      <td>123</td>\n",
       "      <td>27.47</td>\n",
       "      <td>195.5</td>\n",
       "      <td>103</td>\n",
       "      <td>16.62</td>\n",
       "      <td>254.4</td>\n",
       "      <td>103</td>\n",
       "      <td>11.45</td>\n",
       "      <td>13.7</td>\n",
       "      <td>3</td>\n",
       "      <td>3.70</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NJ</td>\n",
       "      <td>137</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>243.4</td>\n",
       "      <td>114</td>\n",
       "      <td>41.38</td>\n",
       "      <td>121.2</td>\n",
       "      <td>110</td>\n",
       "      <td>10.30</td>\n",
       "      <td>162.6</td>\n",
       "      <td>104</td>\n",
       "      <td>7.32</td>\n",
       "      <td>12.2</td>\n",
       "      <td>5</td>\n",
       "      <td>3.29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>OH</td>\n",
       "      <td>84</td>\n",
       "      <td>408</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>299.4</td>\n",
       "      <td>71</td>\n",
       "      <td>50.90</td>\n",
       "      <td>61.9</td>\n",
       "      <td>88</td>\n",
       "      <td>5.26</td>\n",
       "      <td>196.9</td>\n",
       "      <td>89</td>\n",
       "      <td>8.86</td>\n",
       "      <td>6.6</td>\n",
       "      <td>7</td>\n",
       "      <td>1.78</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>OK</td>\n",
       "      <td>75</td>\n",
       "      <td>415</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>166.7</td>\n",
       "      <td>113</td>\n",
       "      <td>28.34</td>\n",
       "      <td>148.3</td>\n",
       "      <td>122</td>\n",
       "      <td>12.61</td>\n",
       "      <td>186.9</td>\n",
       "      <td>121</td>\n",
       "      <td>8.41</td>\n",
       "      <td>10.1</td>\n",
       "      <td>3</td>\n",
       "      <td>2.73</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  State  Account length  Area code International plan Voice mail plan  \\\n",
       "0    KS             128        415                 No             Yes   \n",
       "1    OH             107        415                 No             Yes   \n",
       "2    NJ             137        415                 No              No   \n",
       "3    OH              84        408                Yes              No   \n",
       "4    OK              75        415                Yes              No   \n",
       "\n",
       "   Number vmail messages  Total day minutes  Total day calls  \\\n",
       "0                     25              265.1              110   \n",
       "1                     26              161.6              123   \n",
       "2                      0              243.4              114   \n",
       "3                      0              299.4               71   \n",
       "4                      0              166.7              113   \n",
       "\n",
       "   Total day charge  Total eve minutes  Total eve calls  Total eve charge  \\\n",
       "0             45.07              197.4               99             16.78   \n",
       "1             27.47              195.5              103             16.62   \n",
       "2             41.38              121.2              110             10.30   \n",
       "3             50.90               61.9               88              5.26   \n",
       "4             28.34              148.3              122             12.61   \n",
       "\n",
       "   Total night minutes  Total night calls  Total night charge  \\\n",
       "0                244.7                 91               11.01   \n",
       "1                254.4                103               11.45   \n",
       "2                162.6                104                7.32   \n",
       "3                196.9                 89                8.86   \n",
       "4                186.9                121                8.41   \n",
       "\n",
       "   Total intl minutes  Total intl calls  Total intl charge  \\\n",
       "0                10.0                 3               2.70   \n",
       "1                13.7                 3               3.70   \n",
       "2                12.2                 5               3.29   \n",
       "3                 6.6                 7               1.78   \n",
       "4                10.1                 3               2.73   \n",
       "\n",
       "   Customer service calls  Churn  \n",
       "0                       1      0  \n",
       "1                       1      0  \n",
       "2                       0      0  \n",
       "3                       2      0  \n",
       "4                       3      0  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"Churn\"] = df[\"Churn\"].astype(\"int64\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Account length</th>\n",
       "      <th>Area code</th>\n",
       "      <th>Number vmail messages</th>\n",
       "      <th>Total day minutes</th>\n",
       "      <th>Total day calls</th>\n",
       "      <th>Total day charge</th>\n",
       "      <th>Total eve minutes</th>\n",
       "      <th>Total eve calls</th>\n",
       "      <th>Total eve charge</th>\n",
       "      <th>Total night minutes</th>\n",
       "      <th>Total night calls</th>\n",
       "      <th>Total night charge</th>\n",
       "      <th>Total intl minutes</th>\n",
       "      <th>Total intl calls</th>\n",
       "      <th>Total intl charge</th>\n",
       "      <th>Customer service calls</th>\n",
       "      <th>Churn</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>101.06</td>\n",
       "      <td>437.18</td>\n",
       "      <td>8.10</td>\n",
       "      <td>179.78</td>\n",
       "      <td>100.44</td>\n",
       "      <td>30.56</td>\n",
       "      <td>200.98</td>\n",
       "      <td>100.11</td>\n",
       "      <td>17.08</td>\n",
       "      <td>200.87</td>\n",
       "      <td>100.11</td>\n",
       "      <td>9.04</td>\n",
       "      <td>10.24</td>\n",
       "      <td>4.48</td>\n",
       "      <td>2.76</td>\n",
       "      <td>1.56</td>\n",
       "      <td>0.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>39.82</td>\n",
       "      <td>42.37</td>\n",
       "      <td>13.69</td>\n",
       "      <td>54.47</td>\n",
       "      <td>20.07</td>\n",
       "      <td>9.26</td>\n",
       "      <td>50.71</td>\n",
       "      <td>19.92</td>\n",
       "      <td>4.31</td>\n",
       "      <td>50.57</td>\n",
       "      <td>19.57</td>\n",
       "      <td>2.28</td>\n",
       "      <td>2.79</td>\n",
       "      <td>2.46</td>\n",
       "      <td>0.75</td>\n",
       "      <td>1.32</td>\n",
       "      <td>0.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.00</td>\n",
       "      <td>408.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>23.20</td>\n",
       "      <td>33.00</td>\n",
       "      <td>1.04</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>74.00</td>\n",
       "      <td>408.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>143.70</td>\n",
       "      <td>87.00</td>\n",
       "      <td>24.43</td>\n",
       "      <td>166.60</td>\n",
       "      <td>87.00</td>\n",
       "      <td>14.16</td>\n",
       "      <td>167.00</td>\n",
       "      <td>87.00</td>\n",
       "      <td>7.52</td>\n",
       "      <td>8.50</td>\n",
       "      <td>3.00</td>\n",
       "      <td>2.30</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>101.00</td>\n",
       "      <td>415.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>179.40</td>\n",
       "      <td>101.00</td>\n",
       "      <td>30.50</td>\n",
       "      <td>201.40</td>\n",
       "      <td>100.00</td>\n",
       "      <td>17.12</td>\n",
       "      <td>201.20</td>\n",
       "      <td>100.00</td>\n",
       "      <td>9.05</td>\n",
       "      <td>10.30</td>\n",
       "      <td>4.00</td>\n",
       "      <td>2.78</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>127.00</td>\n",
       "      <td>510.00</td>\n",
       "      <td>20.00</td>\n",
       "      <td>216.40</td>\n",
       "      <td>114.00</td>\n",
       "      <td>36.79</td>\n",
       "      <td>235.30</td>\n",
       "      <td>114.00</td>\n",
       "      <td>20.00</td>\n",
       "      <td>235.30</td>\n",
       "      <td>113.00</td>\n",
       "      <td>10.59</td>\n",
       "      <td>12.10</td>\n",
       "      <td>6.00</td>\n",
       "      <td>3.27</td>\n",
       "      <td>2.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>243.00</td>\n",
       "      <td>510.00</td>\n",
       "      <td>51.00</td>\n",
       "      <td>350.80</td>\n",
       "      <td>165.00</td>\n",
       "      <td>59.64</td>\n",
       "      <td>363.70</td>\n",
       "      <td>170.00</td>\n",
       "      <td>30.91</td>\n",
       "      <td>395.00</td>\n",
       "      <td>175.00</td>\n",
       "      <td>17.77</td>\n",
       "      <td>20.00</td>\n",
       "      <td>20.00</td>\n",
       "      <td>5.40</td>\n",
       "      <td>9.00</td>\n",
       "      <td>1.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Account length  Area code  Number vmail messages  Total day minutes  \\\n",
       "count         3333.00    3333.00                3333.00            3333.00   \n",
       "mean           101.06     437.18                   8.10             179.78   \n",
       "std             39.82      42.37                  13.69              54.47   \n",
       "min              1.00     408.00                   0.00               0.00   \n",
       "25%             74.00     408.00                   0.00             143.70   \n",
       "50%            101.00     415.00                   0.00             179.40   \n",
       "75%            127.00     510.00                  20.00             216.40   \n",
       "max            243.00     510.00                  51.00             350.80   \n",
       "\n",
       "       Total day calls  Total day charge  Total eve minutes  Total eve calls  \\\n",
       "count          3333.00           3333.00            3333.00          3333.00   \n",
       "mean            100.44             30.56             200.98           100.11   \n",
       "std              20.07              9.26              50.71            19.92   \n",
       "min               0.00              0.00               0.00             0.00   \n",
       "25%              87.00             24.43             166.60            87.00   \n",
       "50%             101.00             30.50             201.40           100.00   \n",
       "75%             114.00             36.79             235.30           114.00   \n",
       "max             165.00             59.64             363.70           170.00   \n",
       "\n",
       "       Total eve charge  Total night minutes  Total night calls  \\\n",
       "count           3333.00              3333.00            3333.00   \n",
       "mean              17.08               200.87             100.11   \n",
       "std                4.31                50.57              19.57   \n",
       "min                0.00                23.20              33.00   \n",
       "25%               14.16               167.00              87.00   \n",
       "50%               17.12               201.20             100.00   \n",
       "75%               20.00               235.30             113.00   \n",
       "max               30.91               395.00             175.00   \n",
       "\n",
       "       Total night charge  Total intl minutes  Total intl calls  \\\n",
       "count             3333.00             3333.00           3333.00   \n",
       "mean                 9.04               10.24              4.48   \n",
       "std                  2.28                2.79              2.46   \n",
       "min                  1.04                0.00              0.00   \n",
       "25%                  7.52                8.50              3.00   \n",
       "50%                  9.05               10.30              4.00   \n",
       "75%                 10.59               12.10              6.00   \n",
       "max                 17.77               20.00             20.00   \n",
       "\n",
       "       Total intl charge  Customer service calls    Churn  \n",
       "count            3333.00                 3333.00  3333.00  \n",
       "mean                2.76                    1.56     0.14  \n",
       "std                 0.75                    1.32     0.35  \n",
       "min                 0.00                    0.00     0.00  \n",
       "25%                 2.30                    1.00     0.00  \n",
       "50%                 2.78                    1.00     0.00  \n",
       "75%                 3.27                    2.00     0.00  \n",
       "max                 5.40                    9.00     1.00  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>International plan</th>\n",
       "      <th>Voice mail plan</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>3333</td>\n",
       "      <td>3333</td>\n",
       "      <td>3333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>unique</th>\n",
       "      <td>51</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>top</th>\n",
       "      <td>WV</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>freq</th>\n",
       "      <td>106</td>\n",
       "      <td>3010</td>\n",
       "      <td>2411</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       State International plan Voice mail plan\n",
       "count   3333               3333            3333\n",
       "unique    51                  2               2\n",
       "top       WV                 No              No\n",
       "freq     106               3010            2411"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe(include=['object','bool'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Churn\n",
       "0    2850\n",
       "1     483\n",
       "Name: count, dtype: int64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"Churn\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Churn\n",
       "0    0.86\n",
       "1    0.14\n",
       "Name: proportion, dtype: float64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"Churn\"].value_counts(normalize=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>Account length</th>\n",
       "      <th>Area code</th>\n",
       "      <th>International plan</th>\n",
       "      <th>Voice mail plan</th>\n",
       "      <th>Number vmail messages</th>\n",
       "      <th>Total day minutes</th>\n",
       "      <th>Total day calls</th>\n",
       "      <th>Total day charge</th>\n",
       "      <th>Total eve minutes</th>\n",
       "      <th>Total eve calls</th>\n",
       "      <th>Total eve charge</th>\n",
       "      <th>Total night minutes</th>\n",
       "      <th>Total night calls</th>\n",
       "      <th>Total night charge</th>\n",
       "      <th>Total intl minutes</th>\n",
       "      <th>Total intl calls</th>\n",
       "      <th>Total intl charge</th>\n",
       "      <th>Customer service calls</th>\n",
       "      <th>Churn</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>365</th>\n",
       "      <td>CO</td>\n",
       "      <td>154</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>350.8</td>\n",
       "      <td>75</td>\n",
       "      <td>59.64</td>\n",
       "      <td>216.5</td>\n",
       "      <td>94</td>\n",
       "      <td>18.40</td>\n",
       "      <td>253.9</td>\n",
       "      <td>100</td>\n",
       "      <td>11.43</td>\n",
       "      <td>10.1</td>\n",
       "      <td>9</td>\n",
       "      <td>2.73</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>985</th>\n",
       "      <td>NY</td>\n",
       "      <td>64</td>\n",
       "      <td>415</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>346.8</td>\n",
       "      <td>55</td>\n",
       "      <td>58.96</td>\n",
       "      <td>249.5</td>\n",
       "      <td>79</td>\n",
       "      <td>21.21</td>\n",
       "      <td>275.4</td>\n",
       "      <td>102</td>\n",
       "      <td>12.39</td>\n",
       "      <td>13.3</td>\n",
       "      <td>9</td>\n",
       "      <td>3.59</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2594</th>\n",
       "      <td>OH</td>\n",
       "      <td>115</td>\n",
       "      <td>510</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>345.3</td>\n",
       "      <td>81</td>\n",
       "      <td>58.70</td>\n",
       "      <td>203.4</td>\n",
       "      <td>106</td>\n",
       "      <td>17.29</td>\n",
       "      <td>217.5</td>\n",
       "      <td>107</td>\n",
       "      <td>9.79</td>\n",
       "      <td>11.8</td>\n",
       "      <td>8</td>\n",
       "      <td>3.19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>OH</td>\n",
       "      <td>83</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>337.4</td>\n",
       "      <td>120</td>\n",
       "      <td>57.36</td>\n",
       "      <td>227.4</td>\n",
       "      <td>116</td>\n",
       "      <td>19.33</td>\n",
       "      <td>153.9</td>\n",
       "      <td>114</td>\n",
       "      <td>6.93</td>\n",
       "      <td>15.8</td>\n",
       "      <td>7</td>\n",
       "      <td>4.27</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>605</th>\n",
       "      <td>MO</td>\n",
       "      <td>112</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>335.5</td>\n",
       "      <td>77</td>\n",
       "      <td>57.04</td>\n",
       "      <td>212.5</td>\n",
       "      <td>109</td>\n",
       "      <td>18.06</td>\n",
       "      <td>265.0</td>\n",
       "      <td>132</td>\n",
       "      <td>11.93</td>\n",
       "      <td>12.7</td>\n",
       "      <td>8</td>\n",
       "      <td>3.43</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     State  Account length  Area code International plan Voice mail plan  \\\n",
       "365     CO             154        415                 No              No   \n",
       "985     NY              64        415                Yes              No   \n",
       "2594    OH             115        510                Yes              No   \n",
       "156     OH              83        415                 No              No   \n",
       "605     MO             112        415                 No              No   \n",
       "\n",
       "      Number vmail messages  Total day minutes  Total day calls  \\\n",
       "365                       0              350.8               75   \n",
       "985                       0              346.8               55   \n",
       "2594                      0              345.3               81   \n",
       "156                       0              337.4              120   \n",
       "605                       0              335.5               77   \n",
       "\n",
       "      Total day charge  Total eve minutes  Total eve calls  Total eve charge  \\\n",
       "365              59.64              216.5               94             18.40   \n",
       "985              58.96              249.5               79             21.21   \n",
       "2594             58.70              203.4              106             17.29   \n",
       "156              57.36              227.4              116             19.33   \n",
       "605              57.04              212.5              109             18.06   \n",
       "\n",
       "      Total night minutes  Total night calls  Total night charge  \\\n",
       "365                 253.9                100               11.43   \n",
       "985                 275.4                102               12.39   \n",
       "2594                217.5                107                9.79   \n",
       "156                 153.9                114                6.93   \n",
       "605                 265.0                132               11.93   \n",
       "\n",
       "      Total intl minutes  Total intl calls  Total intl charge  \\\n",
       "365                 10.1                 9               2.73   \n",
       "985                 13.3                 9               3.59   \n",
       "2594                11.8                 8               3.19   \n",
       "156                 15.8                 7               4.27   \n",
       "605                 12.7                 8               3.43   \n",
       "\n",
       "      Customer service calls  Churn  \n",
       "365                        1      1  \n",
       "985                        1      1  \n",
       "2594                       1      1  \n",
       "156                        0      1  \n",
       "605                        2      1  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sort_values(by=\"Total day charge\", ascending=False).head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>Account length</th>\n",
       "      <th>Area code</th>\n",
       "      <th>International plan</th>\n",
       "      <th>Voice mail plan</th>\n",
       "      <th>Number vmail messages</th>\n",
       "      <th>Total day minutes</th>\n",
       "      <th>Total day calls</th>\n",
       "      <th>Total day charge</th>\n",
       "      <th>Total eve minutes</th>\n",
       "      <th>Total eve calls</th>\n",
       "      <th>Total eve charge</th>\n",
       "      <th>Total night minutes</th>\n",
       "      <th>Total night calls</th>\n",
       "      <th>Total night charge</th>\n",
       "      <th>Total intl minutes</th>\n",
       "      <th>Total intl calls</th>\n",
       "      <th>Total intl charge</th>\n",
       "      <th>Customer service calls</th>\n",
       "      <th>Churn</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>688</th>\n",
       "      <td>MN</td>\n",
       "      <td>13</td>\n",
       "      <td>510</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>21</td>\n",
       "      <td>315.6</td>\n",
       "      <td>105</td>\n",
       "      <td>53.65</td>\n",
       "      <td>208.9</td>\n",
       "      <td>71</td>\n",
       "      <td>17.76</td>\n",
       "      <td>260.1</td>\n",
       "      <td>123</td>\n",
       "      <td>11.70</td>\n",
       "      <td>12.1</td>\n",
       "      <td>3</td>\n",
       "      <td>3.27</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2259</th>\n",
       "      <td>NC</td>\n",
       "      <td>210</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>31</td>\n",
       "      <td>313.8</td>\n",
       "      <td>87</td>\n",
       "      <td>53.35</td>\n",
       "      <td>147.7</td>\n",
       "      <td>103</td>\n",
       "      <td>12.55</td>\n",
       "      <td>192.7</td>\n",
       "      <td>97</td>\n",
       "      <td>8.67</td>\n",
       "      <td>10.1</td>\n",
       "      <td>7</td>\n",
       "      <td>2.73</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>534</th>\n",
       "      <td>LA</td>\n",
       "      <td>67</td>\n",
       "      <td>510</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>310.4</td>\n",
       "      <td>97</td>\n",
       "      <td>52.77</td>\n",
       "      <td>66.5</td>\n",
       "      <td>123</td>\n",
       "      <td>5.65</td>\n",
       "      <td>246.5</td>\n",
       "      <td>99</td>\n",
       "      <td>11.09</td>\n",
       "      <td>9.2</td>\n",
       "      <td>10</td>\n",
       "      <td>2.48</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>575</th>\n",
       "      <td>SD</td>\n",
       "      <td>114</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>36</td>\n",
       "      <td>309.9</td>\n",
       "      <td>90</td>\n",
       "      <td>52.68</td>\n",
       "      <td>200.3</td>\n",
       "      <td>89</td>\n",
       "      <td>17.03</td>\n",
       "      <td>183.5</td>\n",
       "      <td>105</td>\n",
       "      <td>8.26</td>\n",
       "      <td>14.2</td>\n",
       "      <td>2</td>\n",
       "      <td>3.83</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2858</th>\n",
       "      <td>AL</td>\n",
       "      <td>141</td>\n",
       "      <td>510</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>28</td>\n",
       "      <td>308.0</td>\n",
       "      <td>123</td>\n",
       "      <td>52.36</td>\n",
       "      <td>247.8</td>\n",
       "      <td>128</td>\n",
       "      <td>21.06</td>\n",
       "      <td>152.9</td>\n",
       "      <td>103</td>\n",
       "      <td>6.88</td>\n",
       "      <td>7.4</td>\n",
       "      <td>3</td>\n",
       "      <td>2.00</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     State  Account length  Area code International plan Voice mail plan  \\\n",
       "688     MN              13        510                 No             Yes   \n",
       "2259    NC             210        415                 No             Yes   \n",
       "534     LA              67        510                 No              No   \n",
       "575     SD             114        415                 No             Yes   \n",
       "2858    AL             141        510                 No             Yes   \n",
       "\n",
       "      Number vmail messages  Total day minutes  Total day calls  \\\n",
       "688                      21              315.6              105   \n",
       "2259                     31              313.8               87   \n",
       "534                       0              310.4               97   \n",
       "575                      36              309.9               90   \n",
       "2858                     28              308.0              123   \n",
       "\n",
       "      Total day charge  Total eve minutes  Total eve calls  Total eve charge  \\\n",
       "688              53.65              208.9               71             17.76   \n",
       "2259             53.35              147.7              103             12.55   \n",
       "534              52.77               66.5              123              5.65   \n",
       "575              52.68              200.3               89             17.03   \n",
       "2858             52.36              247.8              128             21.06   \n",
       "\n",
       "      Total night minutes  Total night calls  Total night charge  \\\n",
       "688                 260.1                123               11.70   \n",
       "2259                192.7                 97                8.67   \n",
       "534                 246.5                 99               11.09   \n",
       "575                 183.5                105                8.26   \n",
       "2858                152.9                103                6.88   \n",
       "\n",
       "      Total intl minutes  Total intl calls  Total intl charge  \\\n",
       "688                 12.1                 3               3.27   \n",
       "2259                10.1                 7               2.73   \n",
       "534                  9.2                10               2.48   \n",
       "575                 14.2                 2               3.83   \n",
       "2858                 7.4                 3               2.00   \n",
       "\n",
       "      Customer service calls  Churn  \n",
       "688                        3      0  \n",
       "2259                       3      0  \n",
       "534                        4      0  \n",
       "575                        1      0  \n",
       "2858                       1      0  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sort_values(by=[\"Churn\", \"Total day charge\"], ascending=[True, False]).head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "df[\"Churn\"].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.14491449144914492"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"Churn\"].mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "df[df[\"Churn\"] == 1].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Account length            102.66\n",
       "Area code                 437.82\n",
       "Number vmail messages       5.12\n",
       "Total day minutes         206.91\n",
       "Total day calls           101.34\n",
       "Total day charge           35.18\n",
       "Total eve minutes         212.41\n",
       "Total eve calls           100.56\n",
       "Total eve charge           18.05\n",
       "Total night minutes       205.23\n",
       "Total night calls         100.40\n",
       "Total night charge          9.24\n",
       "Total intl minutes         10.70\n",
       "Total intl calls            4.16\n",
       "Total intl charge           2.89\n",
       "Customer service calls      2.23\n",
       "Churn                       1.00\n",
       "dtype: float64"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[\"Churn\"] == 1].mean(numeric_only=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "myven",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
